package com.wzapp.sitposture.usercenter.entity;

import com.wzapp.sitposture.common.converter.BigDecimalConverterJson;
import com.wzapp.sitposture.common.converter.DateConverterJson;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

/**
 *  用户收益</br>
 */
@Data
@Entity(name = "user_income")
public class UserIncome implements Serializable {

    private static final long serialVersionUID = -2L;

    @Id
    @GeneratedValue(generator = "uuid_32")
    @GenericGenerator(name = "uuid_32", strategy = "uuid")
    @Column(length = 32)
    private String id;
    /**
     * 用户id
     */
    private String userId;
    /**
     * 收益人名称
     */
    private String account;
    /**
     * 手机号码
     */
    private String mobile;
    /**
     * 消息内容
     */
    @Column(length = 1000)
    private String info;
    /**
     * 金额，单位：元
     */
    @Convert(converter = BigDecimalConverterJson.class)
    private Double amount;
    /**
     * 是否已经返现给邀请人 true,false
     */
    private Boolean deleted;
    /**
     * 创建时间
     */
    @Column(updatable = false)
    @Convert(converter = DateConverterJson.class)
    private Long createTime;
    /**
     * 修改时间
     */
    @Convert(converter = DateConverterJson.class)
    private Long updateTime;
}
